﻿// -----------------------------------------------------------------------
// <copyright file="CrcContract.cs">
// Copyright (c) 2013 Andrey Veselov. All rights reserved.
// License:  Microsoft Public License (MS-PL)
// Contacts: http://andrey.moveax.com  andrey@moveax.com
// </copyright>
// -----------------------------------------------------------------------

namespace PortableImagingLibrary.Png.Crc
{
    using System;
    using System.Diagnostics.Contracts;

    [ContractClassFor(typeof(ICrc))]
    internal abstract class CrcContract : ICrc
    {
        public abstract UInt32 CurrentValue { get; }

        public abstract void Reset();

        public void Update(string value)
        {
            Contract.Requires(!string.IsNullOrEmpty(value));
        }

        public void Update(byte[] buffer)
        {
            Contract.Requires(buffer != null);
        }
    }
}
